package cn.topevery.garden.entity.po;

import cn.topevery.garden.framework.base.BaseEntity;
import com.alibaba.fastjson.annotation.JSONField;
import hw.topevery.framework.annotation.DbTable;
import hw.topevery.framework.annotation.DbTableField;
import hw.topevery.framework.enums.DbTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author code-generate
 * @date 2022-01-05
 */
@Data
@DbTable(tableName = "t_plan")
public class Plan extends BaseEntity {
    /**
     * uuid标识
     */
    @DbTableField(columnName = "c_plan_id", dbType = DbTypeEnum.VARCHAR)
    public String planId;

    /**
     * 编码
     */
    @DbTableField(columnName = "c_code", dbType = DbTypeEnum.VARCHAR)
    public String code;

    /**
     * 名称
     */
    @DbTableField(columnName = "c_name", dbType = DbTypeEnum.VARCHAR)
    public String name;

    /**
     * 区域id
     */
    @DbTableField(columnName = "c_map_id", dbType = DbTypeEnum.VARCHAR)
    public String mapId;

    /**
     * 计划类型code
     */
    @DbTableField(columnName = "c_maintain_type", dbType = DbTypeEnum.VARCHAR)
    public String maintainType;

    /**
     * 计划类型名称
     */
    @DbTableField(columnName = "c_maintain_type_name", dbType = DbTypeEnum.VARCHAR)
    public String maintainTypeName;

    /**
     * 基础数据类型  1,绿地 2,古树名木
     */
    @DbTableField(columnName = "c_obj_type", dbType = DbTypeEnum.INTEGER)
    public Integer objType;

    /**
     * 基础数据Id
     */
    @DbTableField(columnName = "c_obj_id", dbType = DbTypeEnum.VARCHAR)
    public String objId;

    /**
     * 基础数据名称
     */
    @DbTableField(columnName = "c_obj_name", dbType = DbTypeEnum.VARCHAR)
    public String objName;

    /**
     * 总计划开始时间
     */
    @DbTableField(columnName = "c_start_date", dbType = DbTypeEnum.TIMESTAMP)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime startDate;

    /**
     * 总计划结束时间
     */
    @DbTableField(columnName = "c_end_date", dbType = DbTypeEnum.TIMESTAMP)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime endDate;

    /**
     * 养护企业guid
     */
    @DbTableField(columnName = "c_company_id", dbType = DbTypeEnum.VARCHAR)
    public String companyId;

    /**
     * 养护企业简写名称
     */
    @DbTableField(columnName = "c_company_name", dbType = DbTypeEnum.VARCHAR)
    public String companyName;

    /**
     * 0 暂存 1 提交  2 执行中  3 完成
     */
    @DbTableField(columnName = "c_state", dbType = DbTypeEnum.INTEGER)
    public Integer state;

    /**
     * 计划内容
     */
    @DbTableField(columnName = "c_content", dbType = DbTypeEnum.VARCHAR)
    public String content;

    /**
     * 种类
     */
    @DbTableField(columnName = "c_kind", dbType = DbTypeEnum.VARCHAR)
    public String kind;

    /**
     * 数量
     */
    @DbTableField(columnName = "c_number", dbType = DbTypeEnum.INTEGER)
    public Integer number;

    /**
     * 单位
     */
    @DbTableField(columnName = "c_unit", dbType = DbTypeEnum.VARCHAR)
    public String unit;

    /**
     * 子计划开始时间
     */
    @DbTableField(columnName = "c_plan_start_date", dbType = DbTypeEnum.DATE)
    public LocalDate planStartDate;

    /**
     * 子计划结束时间
     */
    @DbTableField(columnName = "c_plan_end_date", dbType = DbTypeEnum.DATE)
    public LocalDate planEndDate;

    /**
     * 执行用量
     */
    @DbTableField(columnName = "c_exec_dosage", dbType = DbTypeEnum.DOUBLE)
    public Double execDosage;

    /**
     * 执行日期
     */
    @DbTableField(columnName = "c_exec_date", dbType = DbTypeEnum.DATE)
    public LocalDate execDate;

    /**
     * 执行说明
     */
    @DbTableField(columnName = "c_exec_desc", dbType = DbTypeEnum.VARCHAR)
    public String execDesc;

    /**
     * 子计划状态 1：待执行 2：已执行
     */
    @DbTableField(columnName = "c_plan_state", dbType = DbTypeEnum.INTEGER)
    public Integer planState;

    /**
     * 备注
     */
    @DbTableField(columnName = "c_remark", dbType = DbTypeEnum.VARCHAR)
    public String remark;

    /**
     * 修改人
     */
    @DbTableField(columnName = "c_db_update_id", dbType = DbTypeEnum.VARCHAR)
    public String dbUpdateId;

    @DbTableField(columnName = "c_section_id", dbType = DbTypeEnum.VARCHAR)
    public String sectionId;

    @DbTableField(columnName = "c_section_name", dbType = DbTypeEnum.VARCHAR)
    public String sectionName;


    /**
     * 修改时间
     */
    @DbTableField(columnName = "c_db_update_date", dbType = DbTypeEnum.TIMESTAMP)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    public LocalDateTime dbUpdateDate;

    @DbTableField(columnName = "c_send", dbType = DbTypeEnum.INTEGER)
    public Boolean send;

    /**
     * 任务下发类型 0：部门 1：人员
     */
    @DbTableField(columnName = "c_send_type", dbType = DbTypeEnum.TINYINT)
    public Byte sendType;

    /**
     * 任务下发对象
     */
    @DbTableField(columnName = "c_send_obj", dbType = DbTypeEnum.VARCHAR)
    public String sendObj;

    @DbTableField(columnName = "c_send_obj_name", dbType = DbTypeEnum.VARCHAR)
    public String sendObjName;

    @ApiModelProperty(value = "附件")
    private List<PlanFile> fileList;
}
